package com.ktjiaoyu.crm.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

/**
 * sys_right
 * @since 2022-03-03
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "sys_right")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer","handler"})
public class Right implements Serializable {

	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "right_code")
	private String rightCode;

	@Column(name = "right_parent_code")
	private String rightParentCode;

	@Column(name = "right_type")
	private String rightType;

	@Column(name = "right_text")
	private String rightText;

	@Column(name = "right_url")
	private String rightUrl;

	@Column(name = "right_tip")
	private String rightTip;

	//多对多
	@ManyToMany(targetEntity = Role.class,mappedBy = "rights")
	@JsonIgnore//转为Json忽略
	private Set<Role> roles=new HashSet<>(0);


}
